<?php

/**
 * 项目：红河移动工程过程管理系统
 *
 * 公司：红河移动分公司
 *
 * @author 李朝应
 *
 * E-mail:lichaoying.hh@163.com
 *
 */
if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Branch_model extends CI_Model {

    function __construct() {
        parent::__construct();
    }
 function getbranchs() {
           return $this->db->order_by("brid","asc")->get('s_branch');
    } 
function getbranchsById($brid) {
           return $this->db->where("brid",$brid)->get('s_branch');
    } 
function getRoleWordById($brid) {
       return $this->db->where("brid", $brid)->get('s_branch')->row()->brRoleWord;
}
function getRiWordById($brid) {
       return $this->db->where("brid", $brid)->get('s_branch')->row()->brRiWord;
} 
function getRoWordById($brid) {
       return $this->db->where("brid", $brid)->get('s_branch')->row()->brRoWord;
} 
function geNodes(){
     return $this->db->select('nid,name')->where('pid',0)->where('type',2)->get('node');  
}
function getYearNow(){
   return $this->db->query(" SELECT YEAR( NOW( ) ) AS y")->row()->y;
}
function getBrnamebyID($brid){
  return $this->db->where("brid", $brid)->get('s_branch')->row()->brname;   
}
}